package com.javasm.mingming.adminuser.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 菜单(AdminMenu)表实体类
 *
 * @author makejava
 * @since 2025-01-15 09:53:16
 */
@SuppressWarnings("serial")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AdminMenu extends Model<AdminMenu> {
    @TableId(type = IdType.AUTO)
    private Long mid;
    //菜单名
    private String menuname;
    //父id
    private Long pid;
    //跳转链接
    private String url;
    //是否显示在导航,1显示,2不显示
    private Integer show;
    //图标
    private String glyphicon;

    //子菜单
    @TableField(exist = false)
    private List<AdminMenu> childList;

    public boolean checkFirst(){
        return pid == 0;
    }

}

